!------------------------------------------------------------------------------
! TJU/Department of Mechanics, Fluid Mechanics, Code START
!------------------------------------------------------------------------------
!> @Author: Jianxin Liu shookware@tju.edu.cn
!> @Date: 2024-08-05 10:35:11
!> @LastEditTime: 2024-08-05 10:35:12
!> @LastEditors: Jianxin Liu shookware@tju.edu.cn
!> @Description:
!> @FilePath: /START_NS_3D/test/field/ex1.f90
!> @Copyright (c) 2024 by Jianxin Liu email: shookware@tju.edu.cn, All Rights Reserved.
!------------------------------------------------------------------------------

program ex_field_primitive

   use petsc_wrapper_system
   use petsc_wrapper_vector
   use petsc_wrapper_domain
   use petsc_wrapper_print
   use mod_primitive
   use petsc
   implicit none
   type(type_domain) :: domain
   type(type_domain_vector) :: rho, u, v, w, T
   type(type_primitive) :: q
   integer :: ierr

   call petsc_initialize()
   call petsc_print("test field primitive")
   call domain%create([5], dof=5, stencil_width=1)
   call rho%create(domain); call rho%set_value(1.0d0)
   call u%create(domain); call u%set_value(1.0d0)
   call v%create(domain); call v%set_value(0.0d0)
   call w%create(domain); call w%set_value(0.0d0)
   call T%create(domain); call T%set_value(1.0d0)

   call q%push(rho=rho, u=u, v=v, w=w, T=T)
   call VecView(q%w%vector, PETSC_VIEWER_STDOUT_WORLD, ierr)
   call q%destroy()
   call petsc_finalize()

end program ex_field_primitive
